package com.weixing.mall.provider.model.vo.report.product;

import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.weixing.mall.base.constant.GlobalConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.net.MalformedURLException;
import java.net.URL;

/**
 * @author jzy
 * @date 2020/6/9
 */
@Data
@ApiModel(value="ProductSaleReportVo", description="商品部报表-1销售报表")
@ContentRowHeight(40)
public class ProductSaleReportVo {
    @ApiModelProperty(value = "商品名称")
    @ExcelProperty("商品名称")
    private String goodsName;
    @ApiModelProperty(value = "商品图片")
    @ExcelIgnore
    private String goodsImg;
    @ExcelProperty("商品图片")
    @ColumnWidth(10)
    private URL goodsImgUrl;
    public void setGoodsImg(String goodsImg) {
        this.goodsImg = goodsImg;
        try {
            if (StrUtil.isNotEmpty(goodsImg)){
                this.goodsImgUrl=new URL(GlobalConstant.IMG_PATH_URL +goodsImg+GlobalConstant.IMG_PATH_URL_SUFFIX);
            }
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
    }
    @ApiModelProperty(value = "日期")
    @ExcelProperty("日期")
    private String date;
    @ApiModelProperty(value = "商品款号")
    @ExcelProperty("商品款号")
    private String styleNo;
    @ApiModelProperty(value = "商品货号")
    @ExcelProperty("商品货号")
    private String goodsSn;
    @ApiModelProperty(value = "商品分类")
    @ExcelProperty("商品分类")
    private String catName;
    @ApiModelProperty(value = "负责人")
    @ExcelProperty("负责人")
    @ExcelIgnore
    private String realName;
    @ApiModelProperty(value = "销售总量（单）")
    @ExcelProperty("销售总量（单）")
    private String saleQuantity;

}
